package com.example.startapp;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;

public class MainActivity extends AppCompatActivity {
    ImageButton btn_yonghu;
    ImageButton btn_shanghu;
    ImageButton btn_guanli;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        btn_yonghu=findViewById(R.id.btn_yonghu);
        btn_shanghu=findViewById(R.id.btn_shanghu);
        btn_guanli=findViewById(R.id.btn_administrator);

        btn_yonghu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                //intent.setClass(MainActivity.this,ClockActivity.class)
                //intent.setAction(Intent.ACTION_VIEW);
                //intent.setData(Uri.parse("https://www.baidu.com"));
                intent.setAction("yonghu.yonghuActivity");
                intent.addCategory(Intent.CATEGORY_DEFAULT);
                startActivity(intent);
            }
        });


        btn_shanghu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                //intent.setClass(MainActivity.this,ClockActivity.class);
//                intent.setAction(Intent.ACTION_VIEW);
//                intent.setData(Uri.parse("https://www.baidu.com"));
                intent.setAction("shanghu.shanghuActivity");
                intent.addCategory(Intent.CATEGORY_DEFAULT);
                startActivity(intent);
            }
        });

        btn_guanli.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                //intent.setClass(MainActivity.this,ClockActivity.class);
//                intent.setAction(Intent.ACTION_VIEW);
//                intent.setData(Uri.parse("https://www.baidu.com"));
                intent.setAction("administrator.administratorActivity");
                intent.addCategory(Intent.CATEGORY_DEFAULT);
                startActivity(intent);
            }
        });



    }
}